package main

import (
	"fmt"
	"path"
	"runtime"
	"time"
)

func log(format string, a ...interface{}) {

	t := time.Now().Format("2006/01/02/15:04:05")
	msg := fmt.Sprintf(format, a...)
	fmt.Printf("%s %s \n ", t, msg)
}

func main() {
	const (
		a = iota
		b
		c
		d
	)
	fmt.Println(a)
	fmt.Println(b)
	fmt.Println(c)
	fmt.Println(d)
	t := time.Now().Format("200601021504")

	fmt.Printf("%T\n", t)

	_, file, line, ok := runtime.Caller(0)
	if ok {
		file = path.Base(file)
		fmt.Println(file)
		fmt.Println(line)
	}
	mes := "this is test message"
	addmesg := "this is add message"
	log(mes, addmesg)
}
